﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LookAHead
{
    class MyMath
    {
        //handle all math diffrents of <=, >= ,<,==,>,< by diffrent of epsilon
        public static double epsilon = 0.000000001;
        /********************************************************************************/
        public static bool Less(double x, double y) //x<y
        {
            return ((y - x) > epsilon);

        }
        /********************************************************************************/
        public static bool Greater(double x, double y) //x>y
        {
            return ((x - y) > epsilon);
        }
        /********************************************************************************/
        public static bool Equal(double x, double y) //x==y
        {
            return ((Math.Abs(y - x)) <= epsilon);
        }
        /********************************************************************************/
        public static bool LessOrEqual(double x, double y) //x>=y
        {
            return ((Less(x, y)) || (Equal(x, y)));
        }
        /********************************************************************************/
        public static bool GreaterOrEqual(double x, double y) //x>=y
        {
            return ((MyMath.Greater(x, y)) || (Equal(x, y)));
        }
        /********************************************************************************/
    }
}
